import App from "../App"
import Home from "../views/Home"
import About from "../views/About"
import {BrowserRouter as Router, Routes, Route, Navigate} from "react-router-dom"

//! 两种路由模式的组件: BrowserRouter(History模式), HashRouter(Hash模式)

/* const baseRouter = () => {
    return ()
} */
//!以上写法可以简写为：
const baseRouter = () => (
    <Router>
        <Routes>
            <Route path="/" element={<App/>}>
                <Route path="/" element={<Navigate to="/home" />}/>
                <Route  path="/home" element={<Home />}/>
                <Route  path="/about" element={<About />}/>
            </Route>
        </Routes>
    </Router>
)

export default baseRouter